package com.sharemarking.system.serializer;

import java.io.IOException;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.JsonSerializer;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.sharemarking.system.dto.ExceptionType;

public class ExceptionTypeSerializer extends JsonSerializer<ExceptionType> {

	@Override
	public void serialize(ExceptionType et, JsonGenerator gen, SerializerProvider pro)
			throws IOException, JsonProcessingException {
		gen.writeStartObject();
		gen.writeFieldName("errCode");
		gen.writeString(et.getErrCode());
		gen.writeFieldName("errMsg");
		gen.writeString(et.getErrMsg());
		gen.writeEndObject();
	}

}
